#include <iostream>
#include <vector>
using namespace std;

vector<int> Xplot;
vector<int> Yplot;

vector<vector<int> > plotxx;
vector<vector<int> > plotyy;

int myabs(int x)
{
	return x<0?-x:x;
}

int GetData()
{
	int x, y=0;
	int Flag = 0;
	while (true)
	{		
		while(true)
		{			
			if (Flag == 2)
			{
				return 1;
			}

			cin>>x;
			cin>>y;					
			if (x == 0 && y == 0)
			{
				Flag++;
				break;
			}
		
			if (myabs(x)>= 231 || myabs(y)>= 231)
			{
				return 0;
			}
		
			Xplot.push_back(x);
			Yplot.push_back(y);
			Flag = 0;
		}
		plotxx.push_back(Xplot);
		plotyy.push_back(Yplot);
		Xplot.clear();
		Yplot.clear();
	}

	return 1;
}

int GetRectanglePlot(vector<int> &xplot, vector<int> &yplot)
{
	int ilen = xplot.size();

	for (int i=0; i<ilen-1; i++)
	{
		for (int j=0; j<ilen-1-i; j++)
		{
			if (xplot[j+1] < xplot[j])
			{
				int tmp = xplot[j+1];
				xplot[j+1] = xplot[j];
				xplot[j] = tmp;
			}

			if (yplot[j+1] < yplot[j])
			{
				int tmp = yplot[j+1];
				yplot[j+1] = yplot[j];
				yplot[j] = tmp;
			}
		}
	}

	return 1;
}


int Output(vector<int> xplot, vector<int> yplot)
{
	int ilen = xplot.size();
	cout<<xplot[0]<<" "<<yplot[0]<<" "<<xplot[ilen-1]<<" "<<yplot[ilen-1]<<endl;
	return 1;
}
int main()
{
	
	int itmp = GetData();	
	if (itmp == 0)
	{
		return 1;
	}

	int ilen = plotxx.size();
	for (int i=0; i<ilen-1; i++)
	{
		GetRectanglePlot(plotxx[i],plotyy[i]);
	}

	for (int i=0; i<ilen-1; i++)
	{
		Output(plotxx[i],plotyy[i]);
	}

	return 1;
}